/****************************************************************************
 *
 * Copyright (C) 2003-2008 Los Alamos National Security, LLC
 *                         Packet Analytics Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License Version 2 as
 * published by the Free Software Foundation.  You may not use, modify or
 * distribute this program under any other version of the GNU General
 * Public License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 ****************************************************************************/
package nfse.dataset.firewall;

import nfse.NetFSE;
import nfse.NetFSERecord;
import nfse.NetFSEUtil;

public class PIXRecord extends NetFSERecord {

    public int getSrcPort() {
        return srcPort;
    }

    public String alertMessage = "";

    public String dstAddr = "";

    public long dstIP = -1;

    public int dstPort = -1;

    public boolean isAlert = false;

    public String message = "";

    public int proto = -1;
    
    public int srcPort = -1;

    public PIXRecord() {
        // PIXRecord.initParsers();
    }

    public PIXRecord(int sensor) {
        this.setSensorID(sensor);

    }

    public String getAlertMessage() {
        return this.alertMessage;
    }

    public long getDstIP() {
        return dstIP;
    }

    public int getDstPort() {
        return dstPort;
    }

    public int[] getIndexedFields() {
        int[] temp = { NetFSE.FIELD_START_TS, NetFSE.FIELD_DST_IP, NetFSE.FIELD_SRC_IP, NetFSE.FIELD_DST_PORT };
        return temp;
    }

    public void setDstIP(long dstIP) {
        this.dstIP = dstIP;
        this.dstAddr = NetFSEUtil.convertLongToIP(dstIP);
    }

    public String toString() {
        return getSrcAddr() + ":" + srcPort + "->" + dstAddr + ":" + dstPort + "(" + message + ")";
    }

}